package com.breakfast.fun.data.entity.user.dynamic;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/8/25.
 */
public class DynamicData {

    /**
     * isFollow : true
     * dynamic : [{"id":970,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"又可以点明天的早餐啦","count":0,"praise":0,"addTime":"2016-08-24 16:39:20","image":"http://m.52letsgo.cn/user_image/7/0/2dc6c943-8_1218019931.jpg","address":""},{"id":950,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"2","count":0,"praise":0,"addTime":"2016-08-23 18:01:07","address":""},{"id":949,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"1","count":0,"praise":0,"addTime":"2016-08-23 18:00:01","address":""},{"id":946,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"为什么传不上去","count":0,"praise":0,"addTime":"2016-08-23 17:57:19","address":""},{"id":940,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"很好吃的花生燕麦粥哦","count":1,"praise":0,"addTime":"2016-08-23 09:22:17","address":""},{"id":927,"userId":5407,"userName":"183****8629","userMobile":"18359928629","userPhoto":"http://m.52letsgo.cn","content":"荤素双搭，不错","count":1,"praise":1,"addTime":"2016-08-22 09:03:09","address":""}]
     * info : {"id":5407,"userName":"183****8629","userMobile":"","userPhoto":"http://m.52letsgo.cn","dynamicCount":6,"followCount":1,"fansCount":1,"inviteCount":2,"address":"福州市"}
     */

    private boolean isFollow;
    /**
     * id : 5407
     * userName : 183****8629
     * userMobile :
     * userPhoto : http://m.52letsgo.cn
     * dynamicCount : 6
     * followCount : 1
     * fansCount : 1
     * inviteCount : 2
     * address : 福州市
     */

    private DynamicInfo info;
    /**
     * id : 970
     * userId : 5407
     * userName : 183****8629
     * userMobile : 18359928629
     * userPhoto : http://m.52letsgo.cn
     * content : 又可以点明天的早餐啦
     * count : 0
     * praise : 0
     * addTime : 2016-08-24 16:39:20
     * image : http://m.52letsgo.cn/user_image/7/0/2dc6c943-8_1218019931.jpg
     * address :
     */

    private List<DynamicBean> dynamic;

    public static DynamicData objectFromData(String str) {

        return new Gson().fromJson(str, DynamicData.class);
    }

    public static List<DynamicData> arrayDynamicDataFromData(String str) {

        Type listType = new TypeToken<ArrayList<DynamicData>>() {
        }.getType();

        return new Gson().fromJson(str, listType);
    }

    public boolean isIsFollow() {
        return isFollow;
    }

    public void setIsFollow(boolean isFollow) {
        this.isFollow = isFollow;
    }

    public DynamicInfo getInfo() {
        return info;
    }

    public void setInfo(DynamicInfo info) {
        this.info = info;
    }

    public List<DynamicBean> getDynamic() {
        return dynamic;
    }

    public void setDynamic(List<DynamicBean> dynamic) {
        this.dynamic = dynamic;
    }


}
